package MOLE.Bill;

import MOLE.*;

/** 
 User ��ժҪ˵����
*/
public class User extends App.User
{
	 public double FandianBili = 0;
	public String AgentUrl = "";

	public User(int uid)
	{
		 Uid = uid;

		Name = (new MOLE.SQLOS("hy_info"))._GetFieldVale("hy_name", " hy_num=" + Uid);
		FandianBili = GetFedyerBili();
		AgentUrl = (new MOLE.SQLOS("agentinfo"))._GetFieldVale("aireturnUrl", " aiagentid=" + Uid);

	}

	public User() //new user
	{
	}



	public final String GetKey()
	{
		int agentId = Uid;
		MOLE.SQLOS o = new MOLE.SQLOS("agentinfo");
		if (o.Exists("aiagentid", agentId))
		{
			DataTable dt = o.GetDataTable("aiagentid", agentId);
			String Key = dt.Rows[0]["aikey"].toString().trim();
			return Key;
		}
		else
		{
			return " ";
		}

	}


	public final double GetFedyerBili()
	{
		String s = "SELECT * FROM  [hy_login_info] where hy_num=" + Uid.toString();
		System.Data.DataTable dt = MOLE.SQL.GetDataTable(s);
		if (dt.Rows.size() == 0)
		{
			return 0;
		}
		else
		{
			return Double.parseDouble(dt.Rows[0]["tichengbili"].toString().trim());
		}
	}

}